const tabs = resolve => require(["@/components/tab.vue"], resolve);
const Cart = resolve => require(["@/pages/cart/cart.vue"], resolve);
const ConfirmOrder = resolve =>
  require(["@/pages/cart/confirmOrder/confirm.vue"], resolve);
const chooseRedPacket = resolve =>
  require(["@/pages/cart/chooseRedPacket/chooseRedPacket.vue"], resolve);
const chooseAddress = resolve =>
  require(["@/pages/cart/chooseAddress/chooseAddress.vue"], resolve);
const ConfirmOrderSuc = resolve =>
  require(["@/pages/cart/success/suc.vue"], resolve);
  const paySuccess = resolve =>
  require(["@/pages/cart/paySuccess/index.vue"], resolve);
const PurchaseManagement = resolve =>
  require(["@/pages/purchaseManagement/manage.vue"], resolve);
const SearchAndResult = resolve =>
  require([
    "@/pages/purchaseManagement/searchAndResult/searchAndResult.vue"
  ], resolve);
const StorePage = resolve =>
  require(["@/pages/purchaseManagement/storePage/storePage.vue"], resolve);
const UsuallyBuyList = resolve =>
  require(["@/pages/purchaseManagement/storePage/usuallyBuyList.vue"], resolve);
const MyPurchase = resolve =>
  require(["@/pages/purchaseManagement/myPurchase/myPurchase.vue"], resolve);
const OrderDetails = resolve =>
  require(["@/pages/purchaseManagement/myPurchase/orderDetails.vue"], resolve);
const OrderTrack = resolve =>
  require(["@/pages/purchaseManagement/myPurchase/orderTrack.vue"], resolve);
const shopManage = resolve =>
  require(["@/pages/purchaseManagement/shopManage/shopManage.vue"], resolve);
const shopInfo = resolve =>
  require(["@/pages/purchaseManagement/shopInfo/shopInfo.vue"], resolve);
const Login = resolve => require(["@/pages/user/login/login.vue"], resolve);

export default [
  {
    path: "/login",
    name: "Login",
    meta: { auth: false },
    component: Login
  },
  // {
  //   path: '/cart',
  //   name: 'Cart',
  //   component: Cart
  // },
  {
    path: "/cart/confirm",
    name: "ConfirmOrder",
    component: ConfirmOrder
  },
  {
    path: "/cart/confirm/success",
    name: "ConfirmOrderSuc",
    component: ConfirmOrderSuc
  },
  {
    path: "/cart/pay/success",
    name: "paySuccess",
    component: paySuccess
  },
  {
    path: "/purchase",
    name: "PurchaseManagement",
    component: PurchaseManagement
  },
  {
    path: "/purchase/searchAndResult",
    name: "SearchAndResult",
    component: SearchAndResult
  },
  // {
  //   path: '/purchase/storePage',
  //   name: 'StorePage',
  //   component: StorePage
  // },
  // {
  //   path: '/purchase/storePage',
  //   name: 'StorePage',
  //   component: StorePage
  // },
  // {
  //   path: '/purchase/myPurchase',
  //   name: 'MyPurchase',
  //   component: MyPurchase
  // },
  {
    path: "/purchase/orderDetails",
    name: "OrderDetails",
    component: OrderDetails
  },
  {
    path: "/purchase/orderTrack",
    name: "OrderTrack",
    component: OrderTrack
  },
  {
    path: "/cart/chooseRedPacket",
    name: "chooseRedPacket",
    component: chooseRedPacket
  },
  {
    path: "/cart/chooseAddress",
    name: "chooseAddress",
    component: chooseAddress
  },
  {
    path: "/shop/manage",
    name: "shopManage",
    component: shopManage
  },
  {
    path: "/shop/info",
    name: "shopInfo",
    component: shopInfo
  },
  {
    path: "/tab",
    name: 'tabBar',
    component: tabs,
    children: [
      {
        path: "/purchase/storePage",
        name: "StorePage",
        component: StorePage,
      },
      {
        path: "/index",
        name: "goodIndex",
        component: resolve => require(["@/pages/goods/index.vue"], resolve)
      },
      /*{
        path: '/purchase/usuallyBuyList',
        name: 'UsuallyBuyList',
        component: UsuallyBuyList
      },*/
      {
        path: "/collect",
        name: "goodCollect",
        component: resolve => require(["@/pages/goods/collect.vue"], resolve)
      },
      {
        path: "/cart",
        name: "Cart",
        component: Cart
      },
      {
        path: "/purchase/myPurchase",
        name: "MyPurchase",
        component: MyPurchase
      }
    ]
  }
];
